namespace FastNet.Core.Configuration;
#nullable disable
public static class AppSetting
{
    public static IConfiguration Configuration { get; private set; }
    public static void Init(IServiceCollection services, IConfiguration configuration)
    {
        Configuration = configuration;
    }
    // 多个节点name格式 ：["key:key1"]
    public static string GetSettingString(string key)
    {
        return Configuration[key];
    }
    // 多个节点,通过.GetSection("key")["key1"]获取
    public static IConfigurationSection GetSection(string key)
    {
        return Configuration.GetSection(key);
    }
    public static string GetString(this IConfigurationSection section, string key)
    {
        return section.GetValue<string>(key);
    }
}
